/*
 * @Description: 结果数据
 * @Author: chenju
 * @Date: 2022-01-21 13:31:29
 * @LastEditors: qingyang
 * @LastEditTime: 2023-06-29 16:44:05
 */
import { get, getBlob } from '@/utils/http';
import { GetTaskDataResultListParams } from './model/reportFormManagementModel';

enum Api {
  // 报表管理列表
  // GET_REPORT_LIST = '/inventory/reportManager/listReportManager',
  // 报表管理导出
  EXPORT_REPORT = '/inventory/reportManager/export',
  // 查询组织任务包含的所有盘查周期
  GET_LIST_PERIOD = '/inventory/statisticsReport/listInventoryYear',
  // 各标准的报表
  GET_REPORT_LIST = '/inventory/statisticsReport/getReport'
}

// 结果列表数据
export const getReportList = (params: GetTaskDataResultListParams): Promise<any> =>
  get(Api.GET_REPORT_LIST, params);

// 结果列表导出
export const exportReport = (params: GetTaskDataResultListParams) =>
  getBlob(Api.EXPORT_REPORT, params);

// 查询组织任务包含的所有盘查周期
export const getListPeriod = (orgCode: string): Promise<string[]> =>
  get(Api.GET_LIST_PERIOD, { orgCode });
